#ifndef TRANSDIALOG_H
#define TRANSDIALOG_H

#include <DDialog>
#include <DLabel>
#include <DTextBrowser>
#include <QtDBus>

DWIDGET_USE_NAMESPACE

class TransDialog : public DDialog {
  Q_OBJECT
public:
  TransDialog(DDialog *parent = nullptr);

  void setInfo(QString word, QString ukphonetic, QString usphonetic,
               QString content);

  void popup();

protected:
  void closeEvent(QCloseEvent *event) override;
  void leaveEvent(QEvent *e) override;
  void focusOutEvent(QFocusEvent *event) override;

private:
  DLabel *m_word, *m_phonetic;
  DTextBrowser *m_content;
};

#endif // TRANSDIALOG_H
